<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/WEB-INF/pages/common/taglibs.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="${ctx}resources/css/screen.css" /> 
<link rel="stylesheet" type="text/css" href="${ctx}resources/css/list.css" />
<script type="text/javascript" src="${ctx}resources/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="${ctx}resources/js/messages_cn.js"></script> 
<script type="text/javascript" src="${ctx}resources/js/jquery.uploadify-3.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="${ctx}resources/css/uploadify.css" /> 
<title>应用程序管理页面</title>
</head>
<script type="text/javascript">
$().ready(function() {
	$("#name").val("");
	$("#signupForm").validate({
		rules: {
			appid: {
				required: true
					　 },
					 name: {
				required: true
					　 },
					 password: {
				required: true
					　 }
		},
		messages: {
			appid: {
				required: "APPID不能为空！"
		},
		name: {
				required: "应用程序名不能为空！"
		},
		password: {
				required: "密码不能为空！"
		}
	}});
	   $('#uploadify').uploadify({
		   	 'formData': {'id':"${application.appid}",'uploader':'app'},
		       'swf': '${ctx}resources/js/uploadify.swf',
		       'method':'post',
		       'buttonText':'上传',
		       'fileObjName':'attachment',
		       'uploader':'${ctx}application/upload.htm;jsessionid=${sessionId}',
		       'onUploadError': function(a, b, c, d){
		       	alert("上传失败");
		       },'onUploadSuccess' : function(file, data, response) {
		           $("#certFile").val(data);
		       }
		   });
}); 
</script>
<body>
<div style="margin: 0px; padding-top:20px; ">
	<form action="${ctx}application/modify.htm" id="signupForm" method="post">
	<input type="hidden" value="${application.id}" name="id">
	<input type="hidden" value="${pageNo}" name="pageNo">
<table width="95%" cellpadding="0" cellspacing="1" align="center" id="bordertable">
    <tr class="tr1" height="40">
			<td align="right" width="40%">APPID:</td>
			<td align="left" width="60%"><input class="input" type="text"  value="${application.appid}" name="appid"></td>
	</tr>
    <tr class="tr1" height="40">
			<td align="right" width="40%">名称:</td>
			<td align="left" width="60%"><input class="input" type="text"  value="${application.name}" name="name"></td>
	</tr>
    <tr class="tr1" height="40">
			<td align="right" width="40%">证书:</td>
			<td align="left" width="60%"><input class="input" type="text"  value="${application.certFile}" id="certFile" name="certFile" readonly="readonly"><input type="button" id="uploadify" value="上传"/></td>
	</tr>
    <tr class="tr1" height="40">
			<td align="right" width="40%">证书类型:</td>
			<td align="left" width="60%"><input  type="radio" name="production" value="1" ${application.production?"checked":""}>正式版<input type="radio" name="production" value="0" ${application.production?"":"checked"}/>测试版</td>
	</tr>
    <tr class="tr1" height="40">
			<td align="right" width="40%">密码:</td>
			<td align="left" width="60%"><input class="input" type="text"  value="${application.password}" name="password"></td>
	</tr>
  <tr height="60px;"  class="tr0">
			<td style="padding-right: 20px;text-align: right;"><input class="button" type="submit" value="提交"/></td>
			<td  style="padding-left: 20px;text-align: left;"><input class="button"  type="reset" value="取消" onclick="javascript:history.back();"/></td>
		</tr>
</table>
	</form>
</div>
</body>

</html>